<{include file="view_header.tpl"}>
<div class="dreamstart"><script type="text/javascript">/*960*90，创建于2012-3-25*/ var cpro_id = 'u821947';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script></div>
<div class="content">
	<div class="nav">
        <a href="/">虫虫书吧</a>&gt;
        <a href="/class/<{$book.fk_category}>_index.html"><{$book.category_name}></a>&gt;
        <span><{$book.book_name}></span>
	</div>
	<div class="cleft">
        <div class="cflist">
        	<div class="bookpic">
            	<img width="124" height="166" src="http://www.5show5.com<{$book.book_pic}>">
            </div>
            <div class="bookintro">
            	<input type='hidden' id='hidBookId' value='<{$book.book_id}>'>
            	<h1><{$book.book_name}></h1>
                <span>作者: <{$book.author}>&nbsp;</span>
                <span>上传时间: <{$book.ctime|date_format:"%Y-%m-%d"}></span>
                <span>书籍大小: <{$book.book_size/1024|string_format:'%.2f'}>KB</span>
            </div>
            <div class="bookdown">
                <a id='download_btn' href="http://www.5show5.com/book/download.php?id=<{$book.book_id}>">点击下载</a>
            </div>
            
            <div class="nologindown" id='logindown'>
            	<div class="ugca">
                    <div class="viewupdata">
                    	<a href="/book/editui/<{$book.book_id}>">编辑此书详情</a>
                    	<a href="/book/uploadUI">上传一本新书</a>
						<a href="javascript:void(0)" id='dump'>转存到我的网盘</a>
                    </div>
                    <div class="downerror">
                    	<span>下载遇到问题？</span>
                        <a href="/user/suggest?e_type=1&book_id=<{$book.book_id}>">1.本书无法下载?</a>
						<a href="/user/suggest?e_type=2&book_id=<{$book.book_id}>">2.本书未完结?</a>
						<a href="/user/suggest?e_type=3&book_id=<{$book.book_id}>">3.本书图书和书名不符?&nbsp;&nbsp;&nbsp;</a>    
                    </div>
                </div>
            </div>
            
        </div>
        <div class="dreamthree">
            <script type="text/javascript">
            <!--
                google_ad_client = "ca-pub-1247895241047138";
                /* 728x90, 创建于 09-11-11 */
                google_ad_slot = "2139712197";
                google_ad_width = 728;
                google_ad_height = 90;
            //-->
            </script>
            <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
        </div>
        <div class="cflist">
            <span class="cflistnm">内容简介</span>
            <p><{$book.book_desn}></p>
        </div>
        <div class="cflist" style="margin-top:10px;">
            <span class="cflistnm">评论</span>
            <ul class="cflistpl">
                <{section loop=$comments name="ls"}>
                <li>
                    <span class="pluser"><{$comments[ls].user_name}></span>
                    <span class="pltime"><{$comments[ls].say_time}></span>
                    <p><{$comments[ls].say_text}></p>
                </li>
                <{/section}>
            </ul>
            <span class="welcomepl">欢迎评论...</span>
            <div class="comment">
            	<div class="comment1">
            		<div class="comment2">
                        <textarea id='commentArea' class="smalltext" name="smalltext">请在这里写下您的评论意见...</textarea>	
                    </div>
                </div>
            </div>
            <div class="commentbt">
            	<div class="commentbtpost">
            		<{nocache}>
                    <{if $_currUser eq "Guest"}>
                    <div class="viewusername1">
                        <input type="text" class="input_username" value="用户名" id='commentUserName'>
                    </div>
                    <div class="viewusername1">
                        <input type="password" class="input_username" value="123456" id='commentPass'>
                    </div>
                    <a href="javascript:void(0)" class="loginpl" id='loginComment'>登录并提交评论</a>
                    <{else}>
                    <a href="javascript:void(0)" class="loginpl" id='submitComment'>提交评论</a>
                    <{/if}>
                    <{/nocache}>
                 </div>
            </div>
        </div>
    </div>
    <div class="cright">
    	<div class="ctjlist">
        	<span class="ctjlist1">该作者的其他作品</span>
            <{section loop=$author_otherbooks name="ls"}>
            <a href="/book/<{$author_otherbooks[ls].book_id}>.html"><{$author_otherbooks[ls].book_name}></a>
            <{/section}>
        </div>
        <div class="dreamtwo">
			<script type="text/javascript"><!--
            google_ad_client = "ca-pub-1247895241047138";
            /* 200x200, 创建于 09-6-18 */
            google_ad_slot = "4323905150";
            google_ad_width = 200;
            google_ad_height = 200;
            //--></script>
            <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
        </div>
    </div>
</div>
<input type='hidden' id='currUser' value='<{$_currUser}>'>
<script>
$(function(){
    $('#commentArea').click(function(){
        if($('#commentArea').text()=='请在这里写下您的评论意见...'){
            $('#commentArea').text('');
        }
    });
    $('#commentArea').blur(function(){
        if($('#commentArea').val()==''){
            $('#commentArea').text('请在这里写下您的评论意见...');
        }
    });
    $('#submitComment').click(function(){
    	if($('#commentArea').val()==''||$('#commentArea').val()=='请在这里写下您的评论意见...'){
    		alert('请输入评论内容再提交');
    		return;
    	}
        var tmp = $('#commentArea').val();
        tmp = html_encode(tmp);
        var bookid = $('#hidBookId').val();
        $('#submitComment').html('正在提交评论中...');
    	ajax_call_and_refresh('/comment/submit',{'bookid':bookid,'content':tmp});
    });
    $('#dump').click(function(){
        $('#dump').html('正在给力转存中...');
        $.getJSON('/user/dump',{'bookId':$('#hidBookId').val()},function(data){
            alert(data.message);
            $('#dump').html('转存到我的网盘');
        });
    });
    $('#loginComment').click(function(){
     	if($('#commentArea').val()==''||$('#commentArea').val()=='请在这里写下您的评论意见...'){
    		alert('请输入评论内容再提交');
    		return;
    	}
        var username = $('#commentUserName').val();
        var pass = $('#commentPass').val();
        ajax_post('/site/login',{'username':username,'password':pass},function(data){
            if(data == 0){
                var tmp = $('#commentArea').val();
                tmp = html_encode(tmp);
                var bookid = $('#hidBookId').val();
                $('#loginComment').html('正在提交评论中...');
                ajax_call_and_refresh('/comment/submit',{'bookid':bookid,'content':tmp});
            }
        });
    });
    $('#loginBtn').click(function(){
        ajax_call_and_refresh('/site/login',{'username':$('#loginUserName').val(),'password':$('#loginPass').val()});
    });
    $('#loginUserName').click(function(){ $(this).val(''); });
    $('#loginPass').click(function(){ $(this).val(''); });
    $('#commentUserName').click(function(){ $(this).val(''); });
    $('#commentPass').click(function(){ $(this).val(''); });
    $('#download_btn').click(function(){
    	$.get('/book/increDownloadTimes',{'id':$('#hidBookId').val()});
    });
});
</script>
<{include file="footer.tpl"}>
